package cn.lg.soar.common.util.token;

import cn.lg.soar.common.util.current.ThreadContext;
import lombok.Data;

/**
 * @author luguoxiang 469599794@qq.com
 * @Date: 2025/1/1 17:18
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Data
public class LoginInfo {

    /**
     * 用户id
     */
    private final long userId;

    /**
     * 用户类型（默认0）
     */
    private final int userType;

    /**
     * 租户id
     */
    private int tenantId = ThreadContext.getTenantId();

    /**
     * 终端类型
     */
    private int clientType;

    public LoginInfo(long userId, int userType) {
        this.userId = userId;
        this.userType = userType;
    }

    public void setClientType(Integer clientType) {
        this.clientType = clientType == null ? 0 : clientType;
    }
}
